/*  1:   */ package org.jetbrains.jps.model.java.impl.compiler;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.util.io.FileUtilRt;
import org.jetbrains.jps.model.java.compiler.JpsCompilerExcludes;
import org.jetbrains.jps.util.JpsPathUtil;

import java.io.File;
import java.util.HashSet;
import java.util.Set;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */ 
/* 10:   */ public class JpsCompilerExcludesImpl
/* 11:   */   implements JpsCompilerExcludes
/* 12:   */ {
/* 13:30 */   private final Set<File> a = new HashSet();
/* 14:31 */   private final Set<File> b = new HashSet();
/* 15:32 */   private final Set<File> c = new HashSet();
/* 16:   */   
/* 17:   */   public void addExcludedFile(String paramString)
/* 18:   */   {
/* 19:36 */     addExcludedFile(JpsPathUtil.urlToFile(paramString));
/* 20:   */   }
/* 21:   */   
/* 22:   */   public void addExcludedDirectory(String paramString, boolean paramBoolean)
/* 23:   */   {
/* 24:41 */     addExcludedDirectory(JpsPathUtil.urlToFile(paramString), paramBoolean);
/* 25:   */   }
/* 26:   */   
/* 27:   */   protected void addExcludedFile(File paramFile)
/* 28:   */   {
/* 29:45 */     this.a.add(paramFile);
/* 30:   */   }
/* 31:   */   
/* 32:   */   protected void addExcludedDirectory(File paramFile, boolean paramBoolean)
/* 33:   */   {
/* 34:49 */     (paramBoolean ? this.c : this.b).add(paramFile);
/* 35:   */   }
/* 36:   */   
/* 37:   */   public boolean isExcluded(File paramFile)
/* 38:   */   {
/* 39:54 */     if (this.a.contains(paramFile)) {
/* 40:55 */       return true;
/* 41:   */     }
/* 42:58 */     if ((!this.b.isEmpty()) || (!this.c.isEmpty()))
/* 43:   */     {
/* 44:59 */       File localFile = FileUtilRt.getParentFile(paramFile);
/* 45:60 */       if (this.b.contains(localFile)) {
/* 46:61 */         return true;
/* 47:   */       }
/* 48:64 */       while (localFile != null)
/* 49:   */       {
/* 50:65 */         if (this.c.contains(localFile)) {
/* 51:66 */           return true;
/* 52:   */         }
/* 53:68 */         localFile = FileUtilRt.getParentFile(localFile);
/* 54:   */       }
/* 55:   */     }
/* 56:71 */     return false;
/* 57:   */   }
/* 58:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.java.impl.compiler.JpsCompilerExcludesImpl

 * JD-Core Version:    0.7.0.1

 */